package com.itcncp.wechat.app.dao.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.itcncp.common.plugin.ToStringSerializer;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

public class UserAccountDay implements Serializable {
    /**
     * 日账日期
     *
     * @mbg.generated
     */
    private Date statisticDate;

    @JSONField(serializeUsing= ToStringSerializer.class)
    private Long accountDayId;

    /**
     * 账户id
     *
     * @mbg.generated
     */
    @JSONField(serializeUsing= ToStringSerializer.class)
    private Long userId;

    /**
     * 期初余额
     *
     * @mbg.generated
     */
    private BigDecimal previousBalance;

    /**
     * 期末余额
     *
     * @mbg.generated
     */
    private BigDecimal endBalance;

    /**
     * 充值
     *
     * @mbg.generated
     */
    private BigDecimal income;

    /**
     * 消费
     *
     * @mbg.generated
     */
    private BigDecimal expend;

    /**
     * 退费
     *
     * @mbg.generated
     */
    private BigDecimal refund;

    /**
     * 提现
     *
     * @mbg.generated
     */
    private BigDecimal cashin;

    private static final long serialVersionUID = 1L;

    public Date getStatisticDate() {
        return statisticDate;
    }

    public void setStatisticDate(Date statisticDate) {
        this.statisticDate = statisticDate;
    }

    public Long getAccountDayId() {
        return accountDayId;
    }

    public void setAccountDayId(Long accountDayId) {
        this.accountDayId = accountDayId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public BigDecimal getPreviousBalance() {
        return previousBalance;
    }

    public void setPreviousBalance(BigDecimal previousBalance) {
        this.previousBalance = previousBalance;
    }

    public BigDecimal getEndBalance() {
        return endBalance;
    }

    public void setEndBalance(BigDecimal endBalance) {
        this.endBalance = endBalance;
    }

    public BigDecimal getIncome() {
        return income;
    }

    public void setIncome(BigDecimal income) {
        this.income = income;
    }

    public BigDecimal getExpend() {
        return expend;
    }

    public void setExpend(BigDecimal expend) {
        this.expend = expend;
    }

    public BigDecimal getRefund() {
        return refund;
    }

    public void setRefund(BigDecimal refund) {
        this.refund = refund;
    }

    public BigDecimal getCashin() {
        return cashin;
    }

    public void setCashin(BigDecimal cashin) {
        this.cashin = cashin;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", statisticDate=").append(statisticDate);
        sb.append(", accountDayId=").append(accountDayId);
        sb.append(", userId=").append(userId);
        sb.append(", previousBalance=").append(previousBalance);
        sb.append(", endBalance=").append(endBalance);
        sb.append(", income=").append(income);
        sb.append(", expend=").append(expend);
        sb.append(", refund=").append(refund);
        sb.append(", cashin=").append(cashin);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserAccountDay other = (UserAccountDay) that;
        return (this.getStatisticDate() == null ? other.getStatisticDate() == null : this.getStatisticDate().equals(other.getStatisticDate()))
            && (this.getAccountDayId() == null ? other.getAccountDayId() == null : this.getAccountDayId().equals(other.getAccountDayId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getPreviousBalance() == null ? other.getPreviousBalance() == null : this.getPreviousBalance().equals(other.getPreviousBalance()))
            && (this.getEndBalance() == null ? other.getEndBalance() == null : this.getEndBalance().equals(other.getEndBalance()))
            && (this.getIncome() == null ? other.getIncome() == null : this.getIncome().equals(other.getIncome()))
            && (this.getExpend() == null ? other.getExpend() == null : this.getExpend().equals(other.getExpend()))
            && (this.getRefund() == null ? other.getRefund() == null : this.getRefund().equals(other.getRefund()))
            && (this.getCashin() == null ? other.getCashin() == null : this.getCashin().equals(other.getCashin()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getStatisticDate() == null) ? 0 : getStatisticDate().hashCode());
        result = prime * result + ((getAccountDayId() == null) ? 0 : getAccountDayId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getPreviousBalance() == null) ? 0 : getPreviousBalance().hashCode());
        result = prime * result + ((getEndBalance() == null) ? 0 : getEndBalance().hashCode());
        result = prime * result + ((getIncome() == null) ? 0 : getIncome().hashCode());
        result = prime * result + ((getExpend() == null) ? 0 : getExpend().hashCode());
        result = prime * result + ((getRefund() == null) ? 0 : getRefund().hashCode());
        result = prime * result + ((getCashin() == null) ? 0 : getCashin().hashCode());
        return result;
    }
}